const wx2my = require('../../../wx2my');
const Behavior = require('../../../Behavior');
var app = getApp();
Page({
  data: {
    dqdj: 0,
    speed: 0
  },
  last: function () {
    var t = this.data.dqdj;
    console.log(t), this.setData({
      dqdj: t - 1
    });
  },
  next: function () {
    var t = this.data.dqdj;
    console.log(t), this.setData({
      dqdj: t + 1
    });
  },
  swiperchange: function (t) {
    console.log(t), this.setData({
      dqdj: t.detail.current
    });
  },
  onLoad: function (t) {
    var l = this,
        a = wx2my.getStorageSync("url"),
        o = wx2my.getStorageSync("xtxx");
    console.log(o), this.setData({
      xtxx: o,
      url: a
    }), wx2my.setNavigationBarColor({
      frontColor: '#000000',
      backgroundColor: '#ffffff'
    }), app.getUserInfo(function (s) {
      console.log(s), l.setData({
        userInfo: s
      }), app.util.request({
        url: "entry/wxapp/MyCost",
        data: {
          user_id: s.id
        },
        success: function (t) {
          console.log(t), l.setData({
            level_cumulative: t.data
          });
        }
      }), app.util.request({
        url: "entry/wxapp/memberlist",
        cachetime: "0",
        success: function (t) {
          console.log(t.data), l.setData({
            navs: t.data
          });
          var a = t.data.length;
          console.log(a);

          for (var o = 0; o < t.data.length; o++) if (t.data[o].id == s.level_id) {
            console.log(o);
            var e = o + 1;
            console.log(e);
            var n = e / a;
            n = (n *= 100).toFixed(0), console.log(n), l.setData({
              dqdj: o,
              speed: n,
              price: t.data[o].value
            });
          }

          l.setData({
            imgarr: t.data
          });
        }
      });
    });
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {}
});